home *** CD-ROM | disk | FTP | other *** search
/ Hottest 6 / Hottest 6 (1996)(PDSoft)[!].iso / software / videoutils / a-g / ami2d / macros / htemp.rexx < prev    next >
OS/2 REXX Batch file  |  1978-11-24  |  2KB  |  93 lines

  1. /* macro to plot deformed model to printer or postscript file */
  2. options results
  3. parse arg dev
  4.  
  5. address ami2d
  6.  
  7. scale = 1.0
  8. 'get scale'
  9. if result ~= 0.0 then scale = result
  10.  
  11. 'info(window)'
  12. parse var result xmin xmax ymin ymax
  13.  
  14. m = open('outfile','ram:plot.gnu','w')
  15.  
  16. select
  17.     when dev='dj' then do
  18.         m = writeln('outfile','set size 1,.86')
  19.         m = writeln('outfile','set term hpdj 300')
  20.         m = writeln('outfile','set output "par:"')
  21.     end
  22.     when dev='ps' then do
  23.         m = writeln('outfile','set size 1.2,1.2')
  24.         m = writeln('outfile','set term postscript eps color "Bodoni-Normal" 14')
  25.         m = writeln('outfile','set output "ram:temp.ps"')
  26.     end
  27.     otherwise nop
  28. end
  29.  
  30. m = writeln('outfile','set xlabel')
  31. m = writeln('outfile','set ylabel')
  32. m = writeln('outfile','set key')
  33. m = writeln('outfile','set noxtics')
  34. m = writeln('outfile','set noytics')
  35. m = writeln('outfile','set noxzeroaxis')
  36. m = writeln('outfile','set noyzeroaxis')
  37. m = writeln('outfile','plot ['xmin':'xmax'] ['ymin':'ymax'] ''pipe:elems'' title "model" with lines 7,\')
  38. m = writeln('outfile','''pipe:temps'' title "temp" with points 3 3')
  39. m = close('outfile')
  40.  
  41. address command 'run gnuplot ram:plot.gnu'
  42.  
  43. 'info'
  44. parse var result nnodes nelems nsolns
  45.  
  46. m = open('outfile','pipe:elems','w')
  47. m = writeln('outfile','# model - 'modelfile' nelems = 'nelems)
  48.  
  49. do i=0 to nelems-1
  50.     'info(elem,'i')'
  51.     parse var result nd id mid nn ni n.1 n.2 n.3 n.4 n.5 n.6 n.7 n.8 n.9
  52.     m = writeln('outfile','# element 'id)
  53.     if nn > 4 then do
  54.         nc = nn % 2
  55.         nm = 2
  56.     end
  57.     else do
  58.         nc = nn
  59.         nm = 1
  60.     end
  61.     do j=1 to nc
  62.         do k=1 to nm
  63.             l = j + nc*(k - 1)
  64.             'info(node,'n.l')'
  65.             parse var result nd id x1 y1
  66.             m = writech('outfile',left(x1,18))
  67.             m = writeln('outfile',left(y1,18))
  68.         end
  69.     end
  70.     'info(node,'n.1')'
  71.     parse var result nd id x1 y1
  72.     m = writech('outfile',left(x1,18))
  73.     m = writeln('outfile',left(y1,18))
  74.     m = writeln('outfile','')
  75. end
  76. m = close('outfile')
  77.  
  78. m = open('outfile','pipe:temps','w')
  79. m = writeln('outfile','# model - 'modelfile' nnodes = 'nnodes)
  80.  
  81. do i=0 to nnodes-1
  82.     'info(pbc,'i')'
  83.     parse var result nd id type kind val
  84.     if kind = 1 then do
  85.         'info(node,'i')'
  86.         parse var result nd id x1 y1
  87.         m = writech('outfile',left(x1,18))
  88.         m = writeln('outfile',left(y1,18))
  89.     end
  90. end
  91. m = close('outfile')
  92. exit
  93.